const resolve = (dir) => path.join(__dirname, dir);
// const CopyWebpackPlugin = require("copy-webpack-plugin")
const path = require("path");
module.exports = {
  publicPath: "./",
  runtimeCompiler: true,
  configureWebpack: {
    resolve: {
      alias: {
        "@": resolve("src"),
      },
    },
  },
  transpileDependencies: ["@dcloudio/uni-ui"],
  devServer: {
    host: "0.0.0.0",
    proxy: {
      "/baseURL": {
        target: "http://bjwj.gstai.com/api",
        changeOrigin: true,
        ws: true,
        pathRewrite: {
          "/baseURL": "",
        },
      },
      "/uploadURL": {
        target: "http://bsddata.oss-cn-hangzhou.aliyuncs.com",
        changeOrigin: true,
        ws: true,
        pathRewrite: {
          "/uploadURL": "",
        },
      },
      "/placeURL": {
        target: "http://xhoa.hjrich.cn",
        changeOrigin: true,
        ws: true,
        pathRewrite: {
          "/placeURL": "",
        },
      },
      "/mediaURL": {
        target: "http://bjwjrmt.gstai.com",
        changeOrigin: true,
        ws: true,
        pathRewrite: {
          "/mediaURL": "",
        },
      },
      "/testURL": {
        target: "http://devrmt.gstai.com",
        changeOrigin: true,
        ws: true,
        pathRewrite: {
          "/testURL": "",
        },
      },
    },
  },
  pages: {
    cloudStorage: {
      entry: "src/pages/cloudStorage/main.js",
      template: "public/cloudStorage.html",
      filename: "cloudStorage.html",
    },
    document: {
      entry: "src/pages/document/main.js",
      template: "public/document.html",
      filename: "document.html",
    },
  },
};
